<?php
//连接数据库

//    function conn(){

        $severname = 'localhost';
        $username = 'root';
        $password = 'root123';
        $dbname = 'oopdb';

        $conn = new mysqli($severname, $username, $password, $dbname);
        if ($conn->connect_error) {
            die("连接失败:".$conn->connect_error);
        }
        echo '数据库连接成功！',PHP_EOL;
//        return $conn;
//    }

?>